package com.yaoxuguang.concurrence.ThreadLocal;

/**
 * @author yaoxuguang
 * @Title: yao-interview
 * @Package com.yaoxuguang.concurrence.ThreadLocal
 * @Description: ThreadLocal存放线程私有的值
 * @date 2018年12月24日14:37
 */
public class ThreadLocal1 {
    public static ThreadLocal threadLocal = new ThreadLocal();

    public static void main(String[] args) {
        if(threadLocal.get()==null){
            System.out.println("未放入值");
            threadLocal.set("my value");
        }
        System.out.println(threadLocal.get());
        System.out.println(threadLocal.get());
    }
}
